package com.corpgovernment.organization.enumm.budget;

import java.util.LinkedHashMap;
import java.util.Map;

public enum BudgetStatusEnum {

    NORMAL("normal", "可使用"),
    FROZEN("frozen", "冻结"),
    NOT_ENOUGH("not_enough", "金额不足"),
    LESS_THRESHOLD("less_threshold", "少于阀值");

    private String status;
    private String desc;

    BudgetStatusEnum(String status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public String getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

    private static Map<String, BudgetStatusEnum> statusMap = new LinkedHashMap<>();

    static {
        for (BudgetStatusEnum budgetTypeEnum : BudgetStatusEnum.values()) {
            statusMap.put(budgetTypeEnum.getStatus(), budgetTypeEnum);
        }
    }

    public static BudgetStatusEnum getEnumByType(String status) {
        return statusMap.get(status);
    }
}